package com.crm.vo;

import com.crm.entity.CrmActivityRemark;
import com.crm.entity.CrmUser;
import com.crm.util.UUIDUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

import static com.crm.commons.constant.Constant.DEFAULT_EDITFLAG;

/**
 * @author junxian.dou
 * @Package：com.crm.vo
 * @Project：springboot-crm
 * @name：ActivityRemark
 * @Date：2024/12/24 18:03
 * @Filename：ActivityRemark
 * @verson 1.0.0
 * @desc
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ActivityRemark implements Serializable {



    private String id;


    private String noteContent;


    private String editFlag;


    private String activityId;

    private String userName;

    private String avatar;

    private String createTime;

    private Boolean showOptions = false;



    public CrmActivityRemark createCrmActivityRemark() {
        CrmActivityRemark crmActivityRemark = new CrmActivityRemark();
        crmActivityRemark.setId(UUIDUtils.getUUID());
        crmActivityRemark.setActivityId(this.activityId);
        crmActivityRemark.setNoteContent(this.noteContent);
        crmActivityRemark.setEditFlag(DEFAULT_EDITFLAG);
        return crmActivityRemark;
    }

    public ActivityRemark(CrmActivityRemark crmActivityRemark, CrmUser crmUser) {
        this.setId(crmActivityRemark.getId());
        this.setActivityId(crmActivityRemark.getActivityId());
        this.setNoteContent(crmActivityRemark.getNoteContent());
        this.setUserName(crmUser.getName());
        this.setAvatar(crmUser.getAvatar());
        this.setCreateTime(crmActivityRemark.getCreateTime());
    }
}
